{% extends 'base.html' %}

{% block title %}new issue{% endblock %}
{% block head %}
<style type="text/css">

</style>
{% endblock %}
{% block content %}

<div class="align-middle col-12 row">
    <h5 class="h2 d-inline">
      <span class="text-muted ">创建 issue</span>
    </h5>
  </div>
<hr class="border-bottom border-info" />
<form method="post" action="{{url_for('faq.create_issue')}}">
    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

    <div class="form-group row">
        <label for="categorys" class="col-sm-2 col-form-label col-form-label-md">Title</label>
        <div class="col-sm-4">
            <input name="title" class="form-control form-control-md" id="title" value="{{ request.form['title'] }}"
                placeholder="Title" required autocomplete='off'>
        </div>
        <small id="emailHelp" class="form-text text-muted">请输入标题</small>
    </div>

    <div class="form-group row">
        <label for="categorys" class="col-sm-2 col-form-label col-form-label-md">categorys</label>
        <div class="col-sm-4">
            <select class="form-control form-control-md " name='category_name' id="category_name" required>
                {% if categorys  %}
                {% for category in categorys %}
                <option>{{category.name}}</option>
                {% endfor %}
                {% else %}
                <option>all</option>
                {% endif %}
            </select>
        </div>
        <small id="emailHelp" class="form-text text-muted">请选择主题</small>
    </div>

    <div class="form-group row">
        <label for="categorys" class="col-sm-2 col-form-label col-form-label-md">Body</label>
        <div class="col-sm-4">
            <textarea name="body" class="form-control form-control-md" rows="10" id="body"
                placeholder="这里输入你的问题，请尽量详细。">{{ request.form['body'] }}</textarea>

        </div>
        <small id="emailHelp" class="form-text text-muted">请输入内容</small>
    </div>
    <div class="form-group row">
        <div class="col-sm-4  offset-2">
            <button type="submit" class="btn btn-primary  btn-block btn-md">save</button>
        </div>
    </div>
</form>


{% endblock %}